package chapter7.quarter2;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Date;

public class ObjectOutputStreamTest {
    public static void main(String[] args) {
        try {
            Date d=new Date();
            FileOutputStream f=new FileOutputStream("date.ser");
            ObjectOutputStream s=new ObjectOutputStream(f);

            s.writeObject(d);
            s.close();
            f.close();

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
